﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL_MechSysWeb;

namespace WEB_MechSysWeb.Paginas_Administrador
{
    public partial class MasterPageAdmin : System.Web.UI.MasterPage
    {
        BLLAgendamento bllAgendamento = new BLLAgendamento();
        BLLCurriculo bllCurriculo = new BLLCurriculo();
        BLLOrdemPendente bllOrdemPendente = new BLLOrdemPendente();
        MembershipUser memberShipUser;

        protected void Page_Load(object sender, EventArgs e)
        {
            HyperLinkRoles.Visible = false;
            if (Roles.IsUserInRole("Cliente"))
            {
                HyperLinkRoles.Text = "Perfil";
                HyperLinkRoles.NavigateUrl = "~/Paginas_Logado/ClientePerfil.aspx";
                HyperLinkRoles.Visible = true;                
            }
            else if (Roles.IsUserInRole("Administrador"))
            {
                HyperLinkRoles.Text = "Administração";
                HyperLinkRoles.NavigateUrl = "~/Paginas_Administrador/PaginaPrincipalAdm.aspx";
                HyperLinkRoles.Visible = true;

                lnkAgendamentos.Text = bllAgendamento.BuscarNumAgendamentosRealizados().ToString();
                lnkCurriculos.Text = bllCurriculo.BuscarNumCurriculosRecebidos().ToString();
                lnkServicos.Text = bllOrdemPendente.BuscarNumOrdensPendentes().ToString();

            }
        }      
    }
}